<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('报价')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-role-add">
			<input id="id" name="id" type="hidden" th:value="${id}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">打车费用：</label>
				<div class="col-sm-8">
					<input class="form-control" type="number" name="orderCarMoney" id="orderCarMoney" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">快递费用：</label>
				<div class="col-sm-8">
					<input class="form-control" type="number" name="orderPostMoney" id="orderPostMoney" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">其他费用：</label>
				<div class="col-sm-8">
					<input class="form-control" type="number" name="orderOtherMoney" id="orderOtherMoney" required>
				</div>
			</div>



		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">

		function submitHandler() {
	        if ($.validate.form()) {
	        	add();
	        }
	    }
	
		function add() {
			var id = $("input[name='id']").val();
			var orderPostMoney = $("input[name='orderPostMoney']").val();
			var orderCarMoney = $("input[name='orderCarMoney']").val();
			var orderOtherMoney = $("input[name='orderOtherMoney']").val();
			console.log(id)
			$.ajax({
				cache : true,
				type : "POST",
				url : "/order/finish",
				data : {
					"id":id,
					"orderPostMoney": orderPostMoney,
					"orderCarMoney": orderCarMoney,
					"orderOtherMoney":orderOtherMoney
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
	</script>
</body>
</html>
